#include "../include/Student.h"

// 构造函数实现
Student::Student(const std::string& id, const std::string& name, 
                 const std::string& gender, const std::string& major)
    : id(id), name(name), gender(gender), major(major) {}

// Getter方法实现
std::string Student::getId() const { return id; }
std::string Student::getName() const { return name; }
std::string Student::getGender() const { return gender; }
std::string Student::getMajor() const { return major; }

// Setter方法实现
void Student::setId(const std::string& id) { this->id = id; }
void Student::setName(const std::string& name) { this->name = name; }
void Student::setGender(const std::string& gender) { this->gender = gender; }
void Student::setMajor(const std::string& major) { this->major = major; }

// 输出运算符重载实现
std::ostream& operator<<(std::ostream& os, const Student& student) {
    os << student.id << '\t' << student.name << '\t' 
       << student.gender << '\t' << student.major;
    return os;
}

// 输入运算符重载实现
std::istream& operator>>(std::istream& is, Student& student) {
    is >> student.id >> student.name >> student.gender >> student.major;
    return is;
}